<?php
/**
 * Truncate helper
 */
class App_View_Helper_Page_Menu extends Zend_View_Helper_Abstract
{
	public function page_Menu($parentId = null, $options = null)
	{
		//TODO : gérer l'arborescences en fonction de $options
		$menu = new Page_Model_Category();
		$html = '<ul id="page-menu">';
		if($parentId) {
			//TODO : sous menu
		}else {
			
			$menus = $menu->fetchParentCategories();	
			
			foreach($menus as $aMenu) {
				//
				$menuUrl =$this->view->url(array('module'=>'page','controller'=>'view','action'=>'menu','menuid'=>$aMenu['id']));
				$menuTitle = $aMenu['title'];
				$html .="<li><a href='$menuUrl>$menuTitle</a></li>";
			}
		}
		$html .= "</ul>";

		return $html;
	}
}
